<template>
	<view class="page-box body_box">
		<!-- 用户信息 -->
		<view class="user-box row-box">
			<view class="header-box">
				<u--image :src="header" shape="circle" width="120rpx" height="120rpx"></u--image>
			</view>
			<view style="margin-left: 20rpx;line-height: 60rpx;">
				<view class="row-box center-box">
					<view style="font-weight: 900;font-size: 42rpx;">{{userInfo.nickName}}</view>
					<view class="row-box center-box user-icon-box">
						<view style="background-color: #fff;width: 42rpx;height: 42rpx;border-radius: 21rpx;" class="center-box">
							<u--image :src="userUrl" width="36rpx" height="36rpx"></u--image>
						</view>
						<view style="margin-left: 10rpx;margin-right: 16rpx;font-size: 26rpx;color: #606266;">总账户</view>
					</view>
				</view>
				<view>{{userInfo.recoveryName}}</view>
			</view>
		</view>
		
		<view class="row-box">
			<!-- 资金组件 -->
			<view class="fund_box" @click="gotoWalletLog">
				<view class="row-box">
					<text style="font-size: 36rpx;font-weight: 900;">资金池 </text>
					<text style="opacity:0">H</text>
					<text style="font-size: 24rpx;">(线上支付)</text>
					<view style="margin-left: 24%;" class="center-box">
						<u-icon name="arrow-right" color="#502b18"></u-icon>
					</view>
				</view>
				<view>{{walletInfo.money}}</view>
				<view style="font-size: 28rpx;">今日支出{{walletInfo.expend}}元</view>
			</view>
			
			<!-- 收货组件 -->
			<view class="collect-box">
				<view class="row-box">
					<view style="font-size: 32rpx;font-weight: 900;">收货次数</view>
					<view style="margin-left: 24%;" class="center-box">
						<u-icon name="arrow-right" color="#fff"></u-icon>
					</view>
				</view>
				<view>5000</view>
				<view>每成交1单扣1次</view>
			</view>
		</view>
		
		<view class="me-goods-box">
			<view class="h2-font" style="margin: 20rpx 0;">货物跟踪</view>
			<view class="row-box">
				<view class="dfh-box">
					<view class="row-box">
						<view style="font-size: 28rpx;font-weight: 900;width: 90%;">待发货</view>
						<view class="center-box">
							<u-icon name="arrow-right" color="#606266"></u-icon>
						</view>
					</view>
					<view style="color: #606266;">
						<text style="font-size: 32rpx;font-weight: 900;">{{trackDetail.waitShipping}}</text>
						<text>台</text>
					</view>
				</view>
				
				<view>
					<view class="me-goods-right-box row-box">
						<view class="h2-font" style="width: 30%;">超时</view>
						<view style="font-size: 22rpx;margin-top: 10rpx;width: 50%;">(未发货)</view>
						<view style="font-weight: 900;color: #fa3534;">{{trackDetail.timeoutShipping}}</view>
						<view class="center-box">
							<u-icon name="arrow-right" color="#606266"></u-icon>
						</view>
					</view>
					<view class="me-goods-right-box row-box" style="margin-top: 20rpx;">
						<view class="h2-font" style="width: 90%;">运单查询</view>
						<view class="center-box">
							<u-icon name="arrow-right" color="#606266"></u-icon>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- <view class="erp-box">
			<view class="h2-font" style="margin: 20rpx 0;">库存ERP</view>
			<view class="row-box">
				<view class="erp-piece-box">
					<view>仓库中</view>
					<view>
						<text class="underline-font">566</text>
						<text>台</text>
					</view>
				</view>
				<view class="erp-piece-box">
					<view>已出库</view>
					<view>
						<text class="underline-font">566</text>
						<text>台</text>
					</view>
				</view>
				<view class="erp-piece-box">
					<view class="top-mini-font">(近30天)</view>
					<view>已销售</view>
					<view>
						<text class="underline-font">566</text>
						<text>台</text>
					</view>
				</view>
			</view>
			
			<view class="row-box" style="margin-top: 50rpx;margin-bottom: 30rpx;">
				<view class="erp-piece-box">
					<view class="top-mini-font">(待处理)</view>
					<view>分货订单</view>
					<view>
						<text class="underline-font">0</text>
						<text>台</text>
					</view>
				</view>
				<view class="erp-piece-box">
					<view class="top-mini-font">(待结算)</view>
					<view>出库订单</view>
					<view>
						<text class="underline-font">0</text>
						<text>台</text>
					</view>
				</view>
				<view class="erp-piece-box">
					<view class="export-box">
						<image class="icon_img" :src="require('@/static/img/quan_xian/export.png')"></image>
					</view>
					数据导出 
				</view>
			</view>
		</view> -->
		
		<my-oher></my-oher>
		
		<view style="height: 200rpx;"></view>
	</view>
</template>

<script>
	import myOher from "@/pages/public/my-other.vue"
	export default {
		components: {myOher},
		data() {
			return {
				header: require("@/static/header.jpg"),
				userUrl: require("@/static/img/user.png"),
				walletInfo: {
					money: 0,
					expend: 0
				},
				//钱包详情
				wallet: undefined,
				//钱包收支记录
				walletLog: [],
				userInfo: uni.getStorageSync(this.$constant.ROLE_INFO_KEY),
				trackDetail: {
					waitShipping: 0,
					timeoutShipping: 0,
					warehouse: 0
				}
			}
		},
		created() {
			this.init();
		},
		methods: {
			init() {
				this.$request("/wallet/detail", "get").then(res => {
					this.walletInfo.money = res.data.wallet.money;
					this.walletInfo.expend = res.data.expend ? res.data.expend : 0;
					this.wallet = res.data.wallet;
				})
				
				this.$request("/appRecoverApi/owner/queryRecycleGoodsTrack", "get").then(res => {
					this.trackDetail = res.data;
				})
			},
			gotoWalletLog() {
				uni.navigateTo({
					url: "/pages/public/wallet-log"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page-box {
		background-image: linear-gradient(to top left, #f2f8fc 30%, #dbf6fe);
		height: 100vh;
	}
	.top-mini-font {
		font-size: 18rpx;
		position: absolute;
		margin-top: -22rpx;
	}
	.underline-font{
		font-size: 32rpx;
		color: #606266;
		text-decoration: underline;
		font-weight: 900;
	} 
	.user-box {
		margin-top: 100rpx;
	}
	.user-icon-box {
		height: 42rpx;
		border-radius: 21rpx;
		background-image: linear-gradient(#dbf1e1, #71d5a1);
		margin-left: 15rpx;
	}
	.fund_box {
		background-image: linear-gradient(to right, #fef3e0, #fbdaa7);
		margin-top: 30rpx;
		width: 50vw;
		padding: 20rpx;
		border-radius: 20rpx;
		line-height: 60rpx;
		color: #502b18;
	}
	.collect-box {
		background-image: linear-gradient(to right, #3c9ee8, #6ed9f6);
		margin-top: 30rpx;
		width: 30vw;
		padding: 20rpx;
		border-radius: 20rpx;
		line-height: 60rpx;
		margin-left: 30rpx;
		color: #FFF;
		font-size: 28rpx;
	}
	.me-goods-box {
		background-color: #FFF;
		margin-top: 30rpx;
		padding: 20rpx;
		border-radius: 20rpx;
	}
	.dfh-box {
		background-color: #f2f8fc;
		width: 40vw;
		padding: 20rpx;
		border-radius: 20rpx;
		line-height: 60rpx;
	}
	.me-goods-right-box {
		background-color: #f2f8fc;
		width: 38vw;
		margin-left: 20rpx;
		padding: 15rpx;
		border-radius: 20rpx;
	}
	.erp-box {
		background-color: #FFF;
		margin-top: 30rpx;
		padding: 20rpx;
		border-radius: 20rpx;
		font-size: 24rpx;
		.erp-piece-box{
			width: 33%;
			padding: 20rpx;
		}
	}
	.export-box{
		background-image: linear-gradient(#77d0ff, #318aff);
		width: 60rpx;
		border-radius: 10rpx;
		margin-top: -20rpx;
		margin-left: 16rpx;
	}
	.other-box {
		background-color: #FFF;
		margin-top: 30rpx;
		padding: 20rpx;
		border-radius: 20rpx;
	}
</style>
